import api from "@/api";
export default {
  namespaced: true, //模块
  state() {
    return {
      rolemanagement: [],
    };
  },
  getters: {},
  mutations: {
    getRole(state, payload) {
      state.rolemanagement = payload;
    },
  },
  actions: {
    async getRole({ commit }) {
      //发起请求并将数据传递给getMenuTree中的payload
      try {
        let { data } = await api.role();
        commit("getRole", data);
      } catch (err) {
        console.log(err);
      }
    },
  },
};
